package com;

import java.awt.*;

public class Bullet {
    Image image;
    int x;
    int y;
    public Bullet(int x,int y){
        this.x= x;
        this.y = y;
        image = ImageIOUtils.getImage(this,"images/mybullet.png");
    }

    public void draw(Graphics graphics) {
        graphics.drawImage(image,x,y,null);
        y = y-10;
    }
    //返回子弹的区域
    public Rectangle getRectangle(){
        return new Rectangle(x,y,image.getWidth(null),image.getHeight(null));
    }
}
